<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="fck" %>
<%@page import="java.util.*,model.*,util.*,control.*"%>
<!DOCTYPE html>
<html>
<head>
    <title>自适应测评系统</title>
    <meta charset="utf-8"/>
    <script  src='../../js/core.js'></script>
    <script  src='../../js/jquery-1.4.2.js'></script>
    <script  src='../../js/rows.js'></script>
    <link type="text/css" rel='stylesheet' href="../../css/common.css"/>
    <link type="text/css" rel='stylesheet' href="../../css/houtai.css"/>
</head>
<body>
           <%
           /***********************************************************************************/
           /*
           *验证权限
           *author 胡瑾
           *data 2011-12-08
           */
			String flag = (String)session.getAttribute("flag");
			String userId = (String)session.getAttribute("userId");
			int adminId = Integer.parseInt(userId);
						
			if (flag != "admin"|| flag == null )
			{
				%>
      <script language="javascript">
				     alert("您没有管理员权限,请重新登录"); window.location.href="../../index.jsp";
				    </script>
      <%
				
			}else{
				Admin admin = new Admin();
				AdminControl ac = new AdminControl();
				admin = ac.GetAdmin(adminId);
				//out.print("<p>"+admin.getName()+"   欢迎您</p>");
				
			}
			/*********************************************************************************/
           %>
<form method="post">
		<table class='main' width='98%'>
		<thead>
        <tr>
          <td>序号</td>
          <td>学号</td>
          <td>成绩</td>
          <td>考试时间（秒）</td>
          <td>考试开始时间</td>
        </tr>
        </thead>
        <%
		int k = 0;
		request.setCharacterEncoding("utf-8");
		int pages = ParamUtil.getInt(request,"pages",1);
		int rowsPerPage = ParamUtil.getInt(request,"pageSize",20);
	    Score score = new Score();
		ScoreControl sc = new ScoreControl();
		
		List<Score>list = new ArrayList<Score>();
		list = (List)sc.GetScore(pages,rowsPerPage);
		
		for(int i = 0; i<list.size();i++)
		{
			score = list.get(i);
			k++;
			//四舍五入
                double score_show = Math.floor((score.getScore() + 0.05d)*10)/10;
%>
	<tbody>	
        <tr >
          <td><%=k %></td>
          <td><%=score.getStudentId()%></td>
          <td><%=score_show %></td>
          <td><%=score.getTestTime() %></td>
          <td><%=score.getTestTime_start() %></td>
        </tr>
        <%} %>
        </tbody>
      </table>
        <p style='margin-left: 20px;'><%
		out.println(ScoreControl.pageInstance.getToolsMenu(pages));
		%></p>
    </form>
  </body>
</html>
